package org.example.controller;


import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/product")
public class ProductController {



//    @PreAuthorize("hasAuthority('PRODUCT_LIST')")
    @PreAuthorize("@myValidator.checkAuthority('PRODUCT_LIST')")
    @RequestMapping("/list")
    public String list() {
        return "list product";
    }


//    @PreAuthorize("hasAuthority('PRODUCT_SAVE')")
    @PreAuthorize("@myValidator.checkAuthority('PRODUCT_SAVE')")
    @RequestMapping("/save")
    public String save() {
        return "save product";
    }
}
